
package run;

import GUI.DragonTray;
import GUI.DragonGUI;
import domain.DomainController;

/**
 * This class is in control of starting HTTPDragon.
 * @author HTTPDragon Team
 */

//javaw -jar httpdragon.jar SSLKEYFILEPASSWORD //Start from commandline without console
//java  -jar httpdragon.jar SSLKEYFILEPASSWORD //Start from commandline with command window as console 
public class StartUp {
    /**
     * This method starts HTTPDragon. The first parameter is the SSL password. It is recommended you start HTTPDragon via a command-line/shell.
     * Without the SSL password the HTTPS module will not start.
     * @param args The first parameter should be the SSL password.
     */
    public static void main(String[] args) {
        // 1 domaincontroller, doorgeven aan alle GUI klassen
        DomainController dc = new DomainController().getInstance();
        if(args.length!=0){
            // 1st argument = SSL password
            dc.setSSLPassPhrase(args[0]);
        }else{
            dc.setSSLPassPhrase("");
        }        
        DragonTray dt = new DragonTray(dc);
        DragonGUI hoofdscherm = new DragonGUI(dc);    
        dc.serverStart();  
 }
}
